#

words=['hello','world','apple','cat']

def fun_test_sequence():
    aa=[]
    for w in words[:]:
        if(len(w)>4):
            aa.append(w[:4])
    print(words)
    print(aa)

#测试range方法
def fun_test_range():
    for i in range(len(words)):
        print(words[i])

#测试内建的enumerate方法
def fun_test_enumerate():
    for i in enumerate(words,0):
        print(i[0],i[1])

#测试参数类型
def fun_test_args(arg1,*arg2,**arg3):
    print(arg1)
    for a in arg2:
        print(a)
    for b in arg3:
        print(b + arg3[b])

def fun_test_lambda():
    pairs=[(1,'one'),(2,'two'),(3,'thress')]
    pairs.sort(key=lambda pair:pair[1])
    print(pairs)

if __name__ == '__main__':
    fun_test_args()
